package net.studou.po;

public class Page {

    private Integer pageSize1 = 30; // 每页多少条 == 黑名单用

    private Integer pageSize2 = 30; // 每页多少条 == 历史任务用

    private Integer pageSize3 = 30; // 每页多少条 == 奖金记录用

    private Integer pageSize4 = 30; // 每页多少条 == 投诉记录用

    private Long sum; // 一共有多少条数据

    @SuppressWarnings("unused")
    private Long countPage; // 一共有多少页

    private Long curPage; // 当前是第几页

    @SuppressWarnings("unused")
    private Long prePage; // 上一页

    @SuppressWarnings("unused")
    private Long nextPage; // 下一页

    public Long getCountPage1() {
        return sum % pageSize1 == 0 ? sum / pageSize1 : sum / pageSize1 + 1;
    }

    public Long getCountPage2() {
        return sum % pageSize2 == 0 ? sum / pageSize2 : sum / pageSize2 + 1;
    }

    public Long getCountPage3() {
        return sum % pageSize3 == 0 ? sum / pageSize3 : sum / pageSize3 + 1;
    }

    public Long getCountPage4() {
        return sum % pageSize4 == 0 ? sum / pageSize4 : sum / pageSize4 + 1;
    }

    public void setCountPage(Long countPage) {
        this.countPage = countPage;
    }

    public Long getCurPage() {
        return curPage;
    }

    public void setCurPage(Long curPage) {
        this.curPage = curPage;
    }

    public Long getNextPage1() {
        if (getCurPage() + 1 > getCountPage1()) {
            return getCountPage1();
        } else {
            return getCurPage() + 1;
        }
    }

    public Long getNextPage2() {
        if (getCurPage() + 1 > getCountPage2()) {
            return getCountPage2();
        } else {
            return getCurPage() + 1;
        }
    }

    public Long getNextPage3() {
        if (getCurPage() + 1 > getCountPage3()) {
            return getCountPage3();
        } else {
            return getCurPage() + 1;
        }
    }
    
    public Long getNextPage4() {
        if (getCurPage() + 1 > getCountPage4()) {
            return getCountPage4();
        } else {
            return getCurPage() + 1;
        }
    }

    public void setNextPage(Long nextPage) {
        this.nextPage = nextPage;
    }

    public Long getPrePage() {
        if (getCurPage() - 1 < 1) {
            return 1l;
        } else {
            return getCurPage() - 1;
        }
    }

    public void setPrePage(Long prePage) {
        this.prePage = prePage;
    }

    public Long getSum() {
        return sum;
    }

    public void setSum(Long sum) {
        this.sum = sum;
    }

    public Integer getPageSize1() {
        return pageSize1;
    }

    public void setPageSize1(Integer pageSize1) {
        this.pageSize1 = pageSize1;
    }

    public Integer getPageSize2() {
        return pageSize2;
    }

    public void setPageSize2(Integer pageSize2) {
        this.pageSize2 = pageSize2;
    }

    public Integer getPageSize3() {
        return pageSize3;
    }

    public void setPageSize3(Integer pageSize3) {
        this.pageSize3 = pageSize3;
    }

    public Integer getPageSize4() {
        return pageSize4;
    }

    public void setPageSize4(Integer pageSize4) {
        this.pageSize4 = pageSize4;
    }

}
